package com.wisdudu.blank.ui.common;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bumptech.glide.Glide;
import com.trello.rxlifecycle.components.support.RxFragment;
import com.wisdudu.blank.R;

import uk.co.senab.photoview.PhotoView;


/**
 * Created by qyf on 2016/5/5.
 */
public class ImageGlanceFragment extends RxFragment {

    PhotoView mImageView;

    public static ImageGlanceFragment newInstance(String path) {

        Bundle args = new Bundle();
        args.putString("image_path", path);
        ImageGlanceFragment fragment = new ImageGlanceFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_image_glance, container, false);
        mImageView = (PhotoView) view.findViewById(R.id.imageView);
        mImageView.setZoomable(true);
//        mImageView.setZoomable(true);
//        mImageView.setMaxScale(3);
        Glide.with(this).load(getArguments().getString("image_path")).into(mImageView);
//        GalleryFinal.getCoreConfig().getImageLoader().displayImage(getActivity(), getArguments().getString("image_path"), mImageView, getResources().getDrawable(R.drawable.icon_sign_logo), 200, 200);
        return view;
    }


}
